import Vue from 'vue';
import Router from 'vue-router';

import Index from '@/pages/index.vue';
import Home from '@/pages/Home.vue';
import NewsList from '@/pages/news/index.vue'
import Details from '@/pages/news/details.vue'
import NoticeDetail from '@/pages/news/noticeDetail.vue'
import SearchList from '@/pages/news/searchList.vue'
import NoticeNew from '@/pages/news/newList.vue'
import Gw from '@/pages/gw/gw.vue'
import Hqsy from '@/pages/hqsy/index.vue'
import details from '@/pages/hqsy/details.vue'
import HqsyDetail from '@/pages/hqsy/details.vue'

Vue.use(Router);

const routes = [
  {
    path: '/', component: Index, name: 'index',
    redirect: '/home',
    meta:{ requiresAuth : true },
    children: [
      {
        path: '/home',
        name: 'home',
        meta:{ requiresAuth : true },
        component: Home,
      },
      {
        path: '/list',
        component: NewsList,
        name: 'NewsList',
        meta:{ requiresAuth : true },
      },
	  {
	    path: '/hqsy',
	    component: Hqsy,
	    name: 'Hqsy',
	    meta:{ requiresAuth : true },
	  },
	  {
	    path: '/hqsyDetail',
	    component: HqsyDetail,
	    name: 'HqsyDetail',
	    meta:{ requiresAuth : true },
	  },
	  {
	    path: '/news',
	    component: NoticeNew,
	    name: 'NoticeNew',
	    meta:{ requiresAuth : true },
	  },
      {
        path: '/noticeDetail',
        component: NoticeDetail,
        name: 'NoticeDetail',
        meta:{ requiresAuth : true },
      },
	  {
	    path: '/gw',
	    component: Gw,
	    name: 'Gw',
	    meta:{ requiresAuth : true },
	  },
      {
        path: '/search',
        component: SearchList,
        name: 'SearchList',
        meta:{ requiresAuth : true },
      },
      {
        path: '/detail',
        component: Details,
        name: 'detail',
        meta:{ requiresAuth : true },
      },
    ]
  },
  // {
  //   path: '/user', component: User,
  //   redirect: '/user/setbindsns',
  //   meta:{ requiresAuth : true },
  //   name:'user',
  //   children: [
  //     {
  //       path: 'setbindsns',
  //       name:'setbindsns',
  //       meta:{ requiresAuth : true },
  //       component: Setbindsns,
  //     },
  //     {
  //       path: 'setprofile',
  //       name:'setprofile',
  //       meta:{ requiresAuth : true },
  //       component: Setprofile,
  //     },
  //     {
  //       path: 'setavator',
  //       name:'setavator',
  //       meta:{ requiresAuth : true },
  //       component: Setavator,
  //     }
  //   ]

  // },
  // {path: '/cart', component: Cart,name:'cart',meta:{ requiresAuth : true }},
  // {path: '/confirmOrder', component: ConfirmOrder,name:'confirmOrder',meta:{ requiresAuth : true }},
  // {path:'/paySuccess',component: PaySuccess,name:'paySuccess'},
  // {path:'/payFail',component: PayFail,name:'payFail'},
  // {path:'/vipSuccess',component: VipSuccess,name:'vipSuccess'},

];

export function createRouter() {
  return new Router({
    mode: "history",
    routes,
  });
}
